package com.atguigu.ronglianyun.sms.auto;

import com.atguigu.ronglianyun.sms.bean.SmsProperties;
import com.atguigu.ronglianyun.sms.service.SmsService;
import com.atguigu.ronglianyun.sms.service.impl.SmsServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(SmsProperties.class)
public class SmsServiceAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean(SmsService.class)
    public SmsService smsService() {
        return new SmsServiceImpl();
    }
}
